/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package GUIComponents;

import MainClasses.*;

import java.awt.event.MouseEvent;
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseListener;
/**
 *
 * @author andrewcutler
 */
public class ClassInfoPanel extends JPanel{
    
    private Course course;
    
    public ClassInfoPanel(Course c)
    {
        course = c;
        this.setBorder(BorderFactory.createLineBorder(Color.black));
        this.setAlignmentX(JComponent.LEFT_ALIGNMENT);
        this.setPreferredSize(new Dimension(100,100));
        this.setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
        JLabel courseName = new JLabel(course.getCourseName());
        courseName.addMouseListener(new LabelEventHandler());
        this.add(new JLabel(course.getPeriodName()));
        this.add(courseName);
        this.add(new JLabel(course.getTeacher()));
    }
    
    private class LabelEventHandler implements MouseListener
    {

        public void mouseClicked(MouseEvent arg0) {
            System.out.println("Mouse Clicked: " + arg0);
        }

        public void mousePressed(MouseEvent arg0) {
            //throw new UnsupportedOperationException("Not supported yet.");
        }

        public void mouseReleased(MouseEvent arg0) {
           // throw new UnsupportedOperationException("Not supported yet.");
        }

        public void mouseEntered(MouseEvent arg0) {
           // throw new UnsupportedOperationException("Not supported yet.");
        }

        public void mouseExited(MouseEvent arg0) {
           // throw new UnsupportedOperationException("Not supported yet.");
        }
        
    }

}
